package com.snut.tomorrowNews.dao.user;

import com.snut.tomorrowNews.model.Collect;
import com.snut.tomorrowNews.model.User;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface UserDao {

    /**
     * 用户注册
     */
    void insertUser(User user);

    User checkUserLogin(User user);

    User getUserById(@Param("id") Integer id);

    void setUser(User user);

    List<Collect> getUserCollect(@Param("id") Integer userId);

    void deleteCollect(@Param("userId")Integer userId, @Param("newsId")Integer newsId);

    void deleteComment(@Param("commentId")Integer commentId);

    void insertCollect(@Param("userId")Integer userId, @Param("newsId")Integer collectNewsId);

    List<User> userList(@Param("userType")Integer userType);

    void updateUserState(@Param("userId") Integer userId,@Param("state") Integer state);
}
